'''
@Project ：hdcms-scripts
@File    ：config.py
@IDE     ：PyCharm
@Author  ：朱广杰
@Date    ：2024/11/8 16:40
'''
import os


# fastapi 启动配置文件
class Config(object):
    """配置类"""
    course_db_config = {
        "host": "10.172.80.185",
        "port": "16033",
        "user": "dever",
        "password": "dever",
        "db": "course"
    }
    user_db_config = {
        "host": "10.172.80.185",
        "port": "16033",
        "user": "dever",
        "password": "dever",
        "db": "user"
    }
    new_user_db_config = {
        "host": "10.170.168.191",
        "port": "3306",
        "user": "user",
        "password": "v7k2dT@wRg7bt7OW",
        "db": "new_user"
    }
    bll_course_db_config = {
        "host": "10.172.80.185",
        "port": "16033",
        "user": "dever",
        "password": "dever",
        "db": "bll_course"
    }



class FilePath(object):
    SETS_PATH = os.path.dirname(os.path.abspath(__file__))  # settings目录

    COM_path = os.path.dirname(os.path.abspath(SETS_PATH))  # commons目录

    APP_PATH = os.path.dirname(os.path.abspath(COM_path))  # app 路径

    BASE_DIR = os.path.dirname(os.path.abspath(APP_PATH))  # 后端服务项目目录

    LOG_FILE_PATH = os.path.join(BASE_DIR, "logs")  # 日志文件路径
    if not os.path.isdir(LOG_FILE_PATH): os.mkdir(LOG_FILE_PATH)

    HD_SERVER = os.path.join(LOG_FILE_PATH, 'hd_server.log')

    HD_ERROR = os.path.join(LOG_FILE_PATH, 'hd_error.log')

    CRUD_PATH = os.path.join(APP_PATH, "crud")  # curd路径

    KEYS_FILE_PATH = os.path.join(SETS_PATH, "keys")  # keys路径
    if not os.path.isdir(KEYS_FILE_PATH): os.mkdir(KEYS_FILE_PATH)

    RSA_PUB_KEY = os.path.join(KEYS_FILE_PATH, "rsa_pub_key")

    RSA_PRI_KEY = os.path.join(KEYS_FILE_PATH, "rsa_pri_key")

